<!DOCTYPE html>
<html>
  <head>
    <title>Verifying you are a human…</title>
    <meta name="title" content="Verifying you are a human…" />
    <meta
      name="description"
      content="A preview of this link is unavailable while a browser check is in progress."
    />

    <meta property="og:type" content="website" />
    <meta property="og:title" content="Verifying you are a human…" />
    <meta
      property="og:description"
      content="A preview of this link is unavailable while a browser check is in progress."
    />

    <meta property="twitter:title" content="Verifying you are a human…" />
    <meta
      property="twitter:description"
      content="A preview of this link is unavailable while a browser check is in progress."
    />

    <style>
      * {
        box-sizing: border-box;
      }
      body {
        max-width: 690px;
        margin: 3em auto;
        padding: 18px;
        font-family: system-ui;
      }
      h1 {
        font-weight: 600;
        font-size: 26px;
        margin-bottom: 0px;
      }
      h2 {
        font-weight: 400;
        font-size: 20px;
        margin-top: 7px;
        margin-bottom: 1.5em;
        color: #171717;
      }
      cap-widget {
        margin-bottom: 4em;
      }
      hr {
        border: 0;
        border-top: 1px solid #dddddd8f;
        margin: 2em 0;
      }
      h3 {
        font-weight: 600;
        font-size: 18px;
        margin-top: 1.5em;
        margin-bottom: 0px;
      }
      p {
        font-weight: 400;
        font-size: 16px;
        line-height: 1.5;
        margin-top: 10px;
        color: #171717;
      }
      footer {
        display: flex;
        gap: 8px;
        align-items: center;
      }
      footer .credit {
        display: flex;
        gap: 8px;
        align-items: center;
        text-decoration: none;
        color: #171717;
      }
      footer .credit:hover {
        opacity: 0.7;
      }
      footer .credit img {
        width: 26px;
        height: 26px;
      }
      footer .date {
        font-size: 15px;
        color: #888;
        margin: 0px;
        margin-left: auto;
      }
    </style>
  </head>
  <body>
    <h1>Checking your browser...</h1>
    <script>
      document.querySelector("h1").innerText = location.host;
    </script>
    <h2>Verifying you are a human before proceeding...</h2>

    <cap-widget id="cap" data-cap-api-endpoint="/__cap_clearance/"></cap-widget>

    <noscript>
      <style>
        .info {
          display: none;
        }
        a {
          color: #0a91e7;
        }
        h3 {
          line-height: 1.3;
          margin-bottom: 1em;
        }
      </style>
      <h3>
        JavaScript is disabled and we were unable to verify you. To access this
        page, please
        <a
          href="https://www.whatismybrowser.com/guides/how-to-enable-javascript/auto"
          target="_blank"
          rel="nofollow noopener"
        >
          enable JavaScript
        </a>
      </h3>
      <hr />
    </noscript>

    <div class="info">
      <hr />

      <h3>Why am I seeing this page?</h3>
      <p>
        To keep our site secure, we need to confirm you're a human and not a
        robot. This quick check helps stop spam and abuse.
      </p>

      <h3>What should I do?</h3>
      <p>
        No action is required on your end. Once verified, you'll continue to
        your destination. If you're stuck, try refreshing the page or checking
        your connection.
      </p>

      <hr />
    </div>

    <footer>
      <a
        href="https://capjs.js.org/"
        target="_blank"
        rel="noopener"
        class="credit"
      >
        <img
          src=""
          aria-hidden="true"
          title="Cap logo"
          alt="Cap logo"
        />
        <span>Cap</span>
      </a>
      <p class="date">{{TIME}}</p>
    </footer>
    <script src="https://cdn.jsdelivr.net/npm/@cap.js/widget@0.1.17"></script>
    <script>
      window.CAP_CUSTOM_FETCH = function (url, options) {
        console.log(url);
        if (url.endsWith("/challenge")) {
          return {
            json: () => {
              return window.CAP_CHALLENGE;
            },
          };
        }
        return fetch(url, options);
      };

      const widget = document.querySelector("cap-widget");

      widget.addEventListener("solve", (event) => {
        document.querySelector("h2").innerText =
          "Continuing to your destination...";

        document.cookie = `__cap_clearance=${
          event.detail.token
        }; path=/; max-age=${
          window.TOKEN_VALIDITY_HOURS * 3_600
        }; SameSite=Strict`;

        setTimeout(() => {
          location.reload();
        }, 300);
      });

      widget.solve();
    </script>
  </body>
</html>
